<template>
	<view>
		<view class="list" v-for="(item,index) in list" :key="item.id" @click="tapSelected(item)">
			<view class="list-img">
				<image :src="item.avatar" mode="aspectFill"></image>
			</view>
			<view class="text">
				<view class="text-title">{{item.nickname}}</view>
				<view class="text-intro">{{item.share_title}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				key: '',
				list: []
			}
		},
		onLoad(option) {
			this.key = option.key;
			let that = this;
			uni.request({
				url: 'https://ms.ys-n.com/api/index/getlist',
				method: 'POST',
				header: {
					'Content-Type': 'application/json',
				},
				data: {},
				success: res => {
					that.list = res.data.data;
				},
				fail: () => {},
				complete: () => {}
			});
		},
		methods: {
			tapSelected(item){
				console.log(item.image,"信息");
				uni.navigateTo({
					url:'/pages/submit/submitto?id='+item.id+'&imgsrc='+item.image
				})
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #F5F5F5;
	}

	.list {
		// width:710rpx;
		height: 177rpx;
		margin: 22rpx 20rpx;
		background-color: #ffffff;
		display: flex;

		.list-img {
			margin: 29rpx 29rpx 28rpx 15rpx;

			image {
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
			}
		}

		.text {
			margin: 27rpx 33rpx 27rpx 0rpx;

			.text-title {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #2E2D2D;
			}

			.text-intro {
				line-height: 30rpx;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #2E2D2D;
				overflow: hidden;
				display: -webkit-box;
				-webkit-line-clamp: 3;
				-webkit-box-orient: vertical;
				overflow: hidden;
	
			}
		}
	}
</style>
